package com.learning.server.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@RestController
public class TestController {

    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public String helloHtml(Model model){

        return "test";
    }


    @RequestMapping(value = "/test2",method = RequestMethod.POST)
    public String helloHtmlRequest(@RequestBody String map){

        return map;
    }

    @RequestMapping(value = "/test3",method = RequestMethod.POST)
    public Map<String,Object>  helloHtmlRequest3(@RequestBody Map<String,Object> map){

        return map;
    }


    @RequestMapping(value = "/test4",method = RequestMethod.POST)
    @ResponseBody
    public Object payGroupList(HttpServletRequest request, HttpServletResponse response)
    {

        return request.getParameterMap();
    }

}
